set current_path=%cd%
set qt_path=C:\Qt\Qt5.14.2\5.14.2\msvc2017_64

mkdir output
cd output
mkdir bin_d
cd %current_path%

@rem Copy dime_d
copy /y "%current_path%\Tools\Win64\dime\bind\*.dll" "%current_path%\output\bin_d"
copy /y "%current_path%\Tools\Win64\dime\bind\*.exe" "%current_path%\output\bin_d"

@rem Copy OCC_d
copy /y "%current_path%\Tools\Win64\OCC\bind\*.dll" "%current_path%\output\bin_d"

@rem Copy HDF5_d
copy /y "%current_path%\Tools\Win64\hdf5\bind\*.dll" "%current_path%\output\bin_d"

@rem Copy PythonQt_d
copy /y "%current_path%\Tools\Win64\PythonQt\bind\*.dll" "%current_path%\output\bin_d"

@rem Copy Python
copy /y "%current_path%\Tools\Win64\Python37\python37.dll" "%current_path%\output\bin_d"

@rem Copy Python Lib
mkdir %current_path%\output\bin_d\Lib
xcopy /e /i /y "%current_path%\Tools\Win64\Python37\Lib" ".\output\bin_d\Lib"

@rem Deploy Qt_d(PythonQt-All)
mkdir %current_path%\output\bin_d\audio
copy /y "%qt_path%\plugins\audio\qtaudio_wasapi.dll" "%current_path%\output\bin_d\audio"
copy /y "%qt_path%\plugins\audio\qtaudio_windows.dll" "%current_path%\output\bin_d\audio"

mkdir %current_path%\output\bin_d\bearer
copy /y "%qt_path%\plugins\bearer\qgenericbearer.dll" "%current_path%\output\bin_d\bearer"

mkdir %current_path%\output\bin_d\iconengines
copy /y "%qt_path%\plugins\iconengines\qsvgicon.dll" "%current_path%\output\bin_d\iconengines"

mkdir %current_path%\output\bin_d\imageformats
copy /y "%qt_path%\plugins\imageformats\qgifd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qicnsd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qicod.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qjpegd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qsvgd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qtgad.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qtiffd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwbmpd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwbmpd.dll" "%current_path%\output\bin_d\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwebpd.dll" "%current_path%\output\bin_d\imageformats"

mkdir %current_path%\output\bin_d\mediaservice
copy /y "%qt_path%\plugins\mediaservice\dsengined.dll" "%current_path%\output\bin_d\mediaservice"
copy /y "%qt_path%\plugins\mediaservice\qtmedia_audioengined.dll" "%current_path%\output\bin_d\mediaservice"
copy /y "%qt_path%\plugins\mediaservice\wmfengined.dll" "%current_path%\output\bin_d\mediaservice"

mkdir %current_path%\output\bin_d\platforminputcontexts
copy /y "%qt_path%\plugins\platforminputcontexts\qtvirtualkeyboardplugind.dll" "%current_path%\output\bin_d\platforminputcontexts"

mkdir %current_path%\output\bin_d\platforms
copy /y "%qt_path%\plugins\platforms\qwindowsd.dll" "%current_path%\output\bin_d\platforms"

mkdir %current_path%\output\bin_d\playlistformats
copy /y "%qt_path%\plugins\playlistformats\qtmultimedia_m3ud.dll" "%current_path%\output\bin_d\playlistformats"

mkdir %current_path%\output\bin_d\printsupport
copy /y "%qt_path%\plugins\printsupport\windowsprintersupportd.dll" "%current_path%\output\bin_d\printsupport"

mkdir %current_path%\output\bin_d\qmltooling
copy /y "%qt_path%\plugins\qmltooling\qmldbg_debuggerd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_inspectord.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_locald.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_messagesd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_natived.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_nativedebuggerd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_previewd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_profilerd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_quickprofilerd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_serverd.dll" "%current_path%\output\bin_d\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_tcpd.dll" "%current_path%\output\bin_d\qmltooling"

mkdir %current_path%\output\bin_d\scenegraph
copy /y "%qt_path%\plugins\scenegraph\qsgd3d12backendd.dll" "%current_path%\output\bin_d\scenegraph"

mkdir %current_path%\output\bin_d\sqldrivers
copy /y "%qt_path%\plugins\sqldrivers\qsqlited.dll" "%current_path%\output\bin_d\sqldrivers"
copy /y "%qt_path%\plugins\sqldrivers\qsqlodbcd.dll" "%current_path%\output\bin_d\sqldrivers"
copy /y "%qt_path%\plugins\sqldrivers\qsqlpsqld.dll" "%current_path%\output\bin_d\sqldrivers"

mkdir %current_path%\output\bin_d\styles
copy /y "%qt_path%\plugins\styles\qwindowsvistastyled.dll" "%current_path%\output\bin_d\styles"

mkdir %current_path%\output\bin_d\virtualkeyboard
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_hanguld.dll" "%current_path%\output\bin_d\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_openwnnd.dll" "%current_path%\output\bin_d\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_pinyind.dll" "%current_path%\output\bin_d\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_tcimed.dll" "%current_path%\output\bin_d\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_thaid.dll" "%current_path%\output\bin_d\virtualkeyboard"

mkdir %current_path%\output\bin_d\translations
copy /y "%qt_path%\translations\qt_ar.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_bg.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_ca.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_cs.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_da.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_de.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_en.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_es.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_fi.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_fr.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_gd.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_he.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_hu.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_it.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_ja.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_ko.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_lv.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_pl.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_ru.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_sk.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_uk.qm" "%current_path%\output\bin_d\translations"
copy /y "%qt_path%\translations\qt_zh_TW.qm" "%current_path%\output\bin_d\translations"

copy /y "%qt_path%\bin\d3dcompiler_47.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\libEGLd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\libGLESv2d.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\opengl32sw.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Cored.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Guid.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Multimediad.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5MultimediaWidgetsd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Networkd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5OpenGLd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5PrintSupportd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Qmld.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5QmlModelsd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Quickd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5QuickWidgetsd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Sqld.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Svgd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Widgetsd.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5Xmld.dll" "%current_path%\output\bin_d"
copy /y "%qt_path%\bin\Qt5XmlPatternsd.dll" "%current_path%\output\bin_d"

cd output
mkdir bin
cd %current_path%

@rem Copy dime
copy /y "%current_path%\Tools\Win64\dime\bin\*.dll" "%current_path%\output\bin"
copy /y "%current_path%\Tools\Win64\dime\bin\*.exe" "%current_path%\output\bin"

@rem Copy OCC
copy /y "%current_path%\Tools\Win64\OCC\bin\*.dll" "%current_path%\output\bin"

@rem Copy HDF5
copy /y "%current_path%\Tools\Win64\hdf5\bin\*.dll" "%current_path%\output\bin"

@rem Copy PythonQt
copy /y "%current_path%\Tools\Win64\PythonQt\bin\*.dll" "%current_path%\output\bin"

@rem Copy Python
copy /y "%current_path%\Tools\Win64\Python37\python37.dll" "%current_path%\output\bin"

@rem Copy Python Lib
mkdir %current_path%\output\bin\Lib
xcopy /e /i /y "%current_path%\Tools\Win64\Python37\Lib" "%current_path%\output\bin\Lib"

@rem Deploy Qt(PythonQt-All)
mkdir %current_path%\output\bin\audio
copy /y "%qt_path%\plugins\audio\qtaudio_wasapi.dll" "%current_path%\output\bin\audio"
copy /y "%qt_path%\plugins\audio\qtaudio_windows.dll" "%current_path%\output\bin\audio"

mkdir %current_path%\output\bin\bearer
copy /y "%qt_path%\plugins\bearer\qgenericbearer.dll" "%current_path%\output\bin\bearer"

mkdir %current_path%\output\bin\iconengines
copy /y "%qt_path%\plugins\iconengines\qsvgicon.dll" "%current_path%\output\bin\iconengines"

mkdir %current_path%\output\bin\imageformats
copy /y "%qt_path%\plugins\imageformats\qgif.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qicns.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qico.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qjpeg.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qsvg.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qtga.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qtiff.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwbmp.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwbmp.dll" "%current_path%\output\bin\imageformats"
copy /y "%qt_path%\plugins\imageformats\qwebp.dll" "%current_path%\output\bin\imageformats"

mkdir %current_path%\output\bin\mediaservice
copy /y "%qt_path%\plugins\mediaservice\dsengine.dll" "%current_path%\output\bin\mediaservice"
copy /y "%qt_path%\plugins\mediaservice\qtmedia_audioengine.dll" "%current_path%\output\bin\mediaservice"
copy /y "%qt_path%\plugins\mediaservice\wmfengine.dll" "%current_path%\output\bin\mediaservice"

mkdir %current_path%\output\bin\platforminputcontexts
copy /y "%qt_path%\plugins\platforminputcontexts\qtvirtualkeyboardplugin.dll" "%current_path%\output\bin\platforminputcontexts"

mkdir %current_path%\output\bin\platforms
copy /y "%qt_path%\plugins\platforms\qwindows.dll" "%current_path%\output\bin\platforms"

mkdir %current_path%\output\bin\playlistformats
copy /y "%qt_path%\plugins\playlistformats\qtmultimedia_m3u.dll" "%current_path%\output\bin\playlistformats"

mkdir %current_path%\output\bin\printsupport
copy /y "%qt_path%\plugins\printsupport\windowsprintersupport.dll" "%current_path%\output\bin\printsupport"

mkdir %current_path%\output\bin\qmltooling
copy /y "%qt_path%\plugins\qmltooling\qmldbg_debugger.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_inspector.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_local.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_messages.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_native.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_nativedebugger.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_preview.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_profiler.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_quickprofiler.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_server.dll" "%current_path%\output\bin\qmltooling"
copy /y "%qt_path%\plugins\qmltooling\qmldbg_tcp.dll" "%current_path%\output\bin\qmltooling"

mkdir %current_path%\output\bin\scenegraph
copy /y "%qt_path%\plugins\scenegraph\qsgd3d12backend.dll" "%current_path%\output\bin\scenegraph"

mkdir %current_path%\output\bin\sqldrivers
copy /y "%qt_path%\plugins\sqldrivers\qsqlite.dll" "%current_path%\output\bin\sqldrivers"
copy /y "%qt_path%\plugins\sqldrivers\qsqlodbc.dll" "%current_path%\output\bin\sqldrivers"
copy /y "%qt_path%\plugins\sqldrivers\qsqlpsql.dll" "%current_path%\output\bin\sqldrivers"

mkdir %current_path%\output\bin\styles
copy /y "%qt_path%\plugins\styles\qwindowsvistastyle.dll" "%current_path%\output\bin\styles"

mkdir %current_path%\output\bin\virtualkeyboard
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_hangul.dll" "%current_path%\output\bin\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_openwnn.dll" "%current_path%\output\bin\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_pinyin.dll" "%current_path%\output\bin\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_tcime.dll" "%current_path%\output\bin\virtualkeyboard"
copy /y "%qt_path%\plugins\virtualkeyboard\qtvirtualkeyboard_thai.dll" "%current_path%\output\bin\virtualkeyboard"

mkdir %current_path%\output\bin\translations
copy /y "%qt_path%\translations\qt_ar.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_bg.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_ca.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_cs.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_da.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_de.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_en.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_es.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_fi.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_fr.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_gd.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_he.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_hu.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_it.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_ja.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_ko.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_lv.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_pl.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_ru.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_sk.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_uk.qm" "%current_path%\output\bin\translations"
copy /y "%qt_path%\translations\qt_zh_TW.qm" "%current_path%\output\bin\translations"

copy /y "%qt_path%\bin\d3dcompiler_47.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\libEGL.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\libGLESv2.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\opengl32sw.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Core.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Gui.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Multimedia.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5MultimediaWidgets.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Network.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5OpenGL.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5PrintSupport.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Qml.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5QmlModels.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Quick.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5QuickWidgets.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Sql.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Svg.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Widgets.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5Xml.dll" "%current_path%\output\bin"
copy /y "%qt_path%\bin\Qt5XmlPatterns.dll" "%current_path%\output\bin"

pause